#pragma once
#include <future>
#include <iostream>
#include <memory>
#include <mutex>
#include <string.h>
#include <thread>
#include <time.h>

using namespace std::string_literals;
using namespace std::chrono_literals;


#include <spdlog/spdlog.h>
#if defined(_WIN32) && defined(_MSC_VER)
#include <spdlog/sinks/msvc_sink.h>
#endif
#include <nlohmann/json.hpp>
#include <pugixml.hpp>
#include <spdlog/fmt/chrono.h>
#include <spdlog/fmt/fmt.h>
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>


#define SINGLETON_DEFINE(TypeName)                                                                           \
    static TypeName *GetInstance() {                                                                         \
        static TypeName type_instance;                                                                       \
        return &type_instance;                                                                               \
    }                                                                                                        \
                                                                                                             \
    TypeName(const TypeName &) = delete;                                                                     \
    TypeName &operator=(const TypeName &) = delete;

struct DeviceInfo {
    std::string IP;
    int Port;
    std::string Manufacturer;
    uint16_t Type = 0;
};

struct KafkaParam {
    std::string URI;
    std::string Topic;
};